package none.rg.gantt.xmlio;


import java.util.*;
import none.rg.gantt.model.*;


/**
 * Class containing text tokens for XML files.
 * @author Rodion Gorkovenko
 */
public class Names {
    
    public static final String TAG_CHART = "gantt-chart";
    public static final String TAG_TASK = "task";
    public static final String TAG_DEP = "dep";
    public static final String TAG_CHILD = "child";
    
    public static final String ATTR_CHART_FINISH = "end";
    public static final String ATTR_CHART_IMPOSSIBLE = "impossible";
    public static final String ATTR_TASK_TITLE = "title";
    public static final String ATTR_TASK_ID = "id";
    public static final String ATTR_TASK_DUR = "dur";
    public static final String ATTR_TASK_START = "start";
    public static final String ATTR_TASK_FINISH = "end";
    public static final String ATTR_TASK_CRITICAL = "critical";
    public static final String ATTR_TASK_RUBBER = "rubber";
    public static final String ATTR_TASK_SPECIAL = "special";
    public static final String ATTR_DEP_PRED = "pred";
    public static final String ATTR_DEP_PREDID = "pred-id";
    public static final String ATTR_DEP_TYPE = "type";
    public static final String ATTR_DEP_LAG = "lag";
    
    public static final Map<String, Link.Type> linkTypes;
    public static final Map<Link.Type, String> linkTypesStr;
    public static final Map<Task.Critical, String> criticalFlags;
    
    
    static {
        Map<String, Link.Type> map = new HashMap<>();
        map.put("fs", Link.Type.FINISH_START);
        map.put("ss", Link.Type.START_START);
        map.put("ff", Link.Type.FINISH_FINISH);
        map.put("sf", Link.Type.START_FINISH);
        linkTypes = Collections.unmodifiableMap(map);
        
        Map<Link.Type, String> map2 = new HashMap<>();
        for (Map.Entry<String, Link.Type> ent : map.entrySet()) {
            map2.put(ent.getValue(), ent.getKey());
        } // for
        linkTypesStr = Collections.unmodifiableMap(map2);
        
        Map<Task.Critical, String> map3 = new HashMap<>();
        map3.put(Task.Critical.NONE, "none");
        map3.put(Task.Critical.START, "start");
        map3.put(Task.Critical.FINISH, "finish");
        map3.put(Task.Critical.FULL, "full");
        criticalFlags = Collections.unmodifiableMap(map3);
        
    } // static
    
    private Names() {}
    
    
} // Names
